package com.qingcheng.dao;

import com.qingcheng.pojo.system.Resource;
import com.qingcheng.pojo.system.Role;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface RoleMapper extends Mapper<Role> {

    @Select("SELECT id,res_key resKey,res_name resName, parent_id parentId FROM `tb_resource` where id in (select resource_id from tb_role_resource where role_id= #{roleId})")
    public List<Resource> findResourcesByRoleId(Integer roleId);
}